var ActivityManaged = function () {
    return {
    	init:function(){
    		 /*$("#search").click(function(){
    			 table.draw();
    		 })*/
    		 $("[name='activity_modify_btn']").click(function(){
    			 var id = $(this).attr("data-id");
    			 $("#activity_modify_dialog").modal({
    				remote:"/admin/activity/updateDialog?id="+id	 
    			 });
    		 });
    		 $("[name='award_manage_btn']").click(function(){
     			var id = $(this).attr("data-id");
     			$("#page-content").load("/admin/activity/lottery?id="+id);
     		 });
    		 $("#activity_modify_dialog").on("hidden.bs.modal", function() {
 			    $(this).removeData("bs.modal");
    		 });
    		 $("#activity_modify_dialog").on("click","#actvitySaveSubmit",function(){
    			$.post("/admin/activity/update",$("#activityUpdateForm").serialize(),function(data){
    				if(data.code==200){
    					 layer.msg("修改成功");
    					 $("#activity_modify_dialog").modal("hide");
    				}else{
    					 layer.msg(data.msg);
    				}
    				
    			}) 
    		 });
    		  
    	}
    }
}();